#include<stdio.h>
int n,l,r;
int main() {
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	scanf("%d%d%d",&n,&l,&r);
	if(r-l>=n) {
		r=r/n*n-1;
	}
	printf("%d",r-(r/n)*n);

	return 0;
}
